home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Fight / fight.jar / FightTimer.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-09-06  |  671 b   |  26 lines

  1. import java.util.Timer;
  2. import java.util.TimerTask;
  3.  
  4. class FightTimer extends TimerTask {
  5.    FightCanvas parent;
  6.    Timer timer;
  7.  
  8.    FightTimer(FightCanvas var1) {
  9.       this.parent = var1;
  10.       this.timer = new Timer();
  11.       this.timer.schedule(this, 0L, 125L);
  12.    }
  13.  
  14.    public void run() {
  15.       this.parent.run();
  16.    }
  17.  
  18.    void stop() {
  19.       if (this.timer != null) {
  20.          ((TimerTask)this).cancel();
  21.          this.timer.cancel();
  22.          this.timer = null;
  23.       }
  24.    }
  25. }
  26.